package com.map.recreation.co.coloradorecreationmap;

import android.content.Context;
import android.util.Log;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.maps.android.clustering.ClusterManager;
import com.google.maps.android.clustering.view.DefaultClusterRenderer;
import com.map.recreation.co.provider.CampSite;

/**
 * Created by Matt on 8/26/2014.
 */
class MyClusterRenderer extends DefaultClusterRenderer<CampSite> {

    public MyClusterRenderer(Context context, GoogleMap map, ClusterManager<CampSite> clusterManager) {
        super(context, map, clusterManager);
    }

    @Override
    protected void onBeforeClusterItemRendered(CampSite site, MarkerOptions markerOptions) {
        super.onBeforeClusterItemRendered(site, markerOptions);
        markerOptions.title(site.getName() + "\n" + site.getPhone());
        markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.campground));
    }

    @Override
    protected void onClusterItemRendered(CampSite clusterItem, Marker marker) {
        super.onClusterItemRendered(clusterItem, marker);
        //here you have access to the marker itself
    }
}
